Giter Club home page Giter Club logo

permissioning-smart-contracts's Introduction

Permissioning Smart Contracts

⚠️ Project Archival Notice ⚠️

This repository is archived.

You can still use onchain permissioning with Besu however we do not plan to further develop either the specific implementation of these contracts or the dapp that is contained in this repository.

Additionally, due to outdated dependencies, the below instructions to build and run the dapp may not work for new users.

Audit

Version 1 of these contracts was audited by a third party. Read the report here

License

The contents of this repository are Apache 2.0 licensed. Important: The dependency chain for this Dapp includes web3js which is LGPL licensed.

Using

You probably got here from Besu. The Besu documentation describes how to use the contracts for onchain permissioning with Besu.

We recommend you use the latest released version of this project.

Development

Note: The build process for the Dapp is currently not supported on Windows. Please use the provided distribution available at the projects release page if on Windows.

Initialize dependencies

Run yarn install to initialize project dependencies. This step is only required when setting up the project for the first time.

Linting

Linting is set up for contracts using solium, and for source files using prettier. To run linting over your code execute yarn run lint.

Testing

yarn test

Permissioning Management Dapp

The Dapp will facilitate managing permissioning rules and maintaining the list of admin accounts that can edit rules.

Note: if you want to run against Besu, follow the Besu docs.

ONLY use these instructions if you are doing development work on the Dapp itself, in which case connecting to a development server (Ganache) will enable faster development.

This is the easiest way to get started for development with the permissioning Dapp:

Compile and migrate the contracts (Development mode)

  1. Delete your environment variables named NODE_INGRESS_CONTRACT_ADDRESS, ACCOUNT_INGRESS_CONTRACT_ADDRESS, ACCOUNT_STORAGE_CONTRACT_ADDRESS, NODE_STORAGE_CONTRACT_ADDRESS AND CHAIN_ID - you might need to restart your terminal session to have your changes applied. If you are using a .env file, you can comment out the variables.
  2. Start a terminal session and start a Truffle Ganache node running truffle develop. This will start a Ganache node and create a Truffle console session.
  3. In the truffle console, run all migrations from scratch with migrate --reset. Keep this terminal session open to maintain your Ganache node running.

Start the development server

  1. Run yarn run build to build the Dapp.
  2. Run yarn run start to start the web server that is serving our Dapp.
  3. In your browser, connect MetaMask to the Ganache network (the default endpoint is http://127.0.0.1:9545/)
  4. When you start Ganache, it gives you a list of accounts and private keys. Import the first one in MetaMask to impersonate the first admin of the system.
  5. Navigate to http://localhost:3000 to access the Permissioning Dapp.
  6. All changes made to the smart contracts or to the Dapp code are automatically refreshed on the website. There is no need to restart the web server after making changes.

Snapshots

Snapshots are compared as part of the test suite, to check any changes made to the Dapp are sensible. If you change the Dapp, you also need to update the snapshots.

  1. yarn jest -u
  2. or if using npm: npm run test:app -- -u

Build the permissioning Dapp for deployment

  1. Compile and migrate the contracts
  2. Run yarn run build will assemble index.html and all other files in build/
  3. You can use your preferred web server technology to serve the contents of build/ as static files.
  4. You will need to set up MetaMask as for the development server

Deployment

Deploying the contracts

  1. The Besu documentation describes how to use the contracts for onchain permissioning with Besu, including setting environment variables.
  2. The following additional environment variables are optional and can be used to prevent redeployment of rules contracts. If set to true, that contract will not be redeployed and current list data will be preserved. If absent or not set to true, the specified contract will be redeployed. This allows you, for instance, to retain the Admin contract while redeploying NodeRules and AccountRules, or any other combination.
  • RETAIN_ADMIN_CONTRACT=true
  • RETAIN_NODE_RULES_CONTRACT=true
  • RETAIN_ACCOUNT_RULES_CONTRACT=true
  1. The following additional environment variables are optional and can be used to permit accounts and nodes during initial contract deployment
  • INITIAL_ADMIN_ACCOUNTS: The admin account addresses. Comma-separated multiple addresses can be specified
  • INITIAL_ALLOWLISTED_ACCOUNTS: The permitted account addresses. Comma-separated multiple addresses can be specified
  • INITIAL_ALLOWLISTED_NODES: The enode URLs of permitted nodes. Comma-separated multiple nodes can be specified
  1. With these environment variables provided, run truffle migrate --reset to deploy the contracts. The console will display the addresses of the contracts deployed.

Deploying the Dapp

  1. Obtain the most recent release (tarball or zip) from the projects release page
  2. Unpack the distribution into a folder that will be available to your webserver
  3. Add to the root of that folder a file config.json with the following contents

Note: The networkID is defined as the chainID in the genesis file.

{
        "accountIngressAddress":  "<Address of the account ingress contract>",
        "nodeIngressAddress": "<Address of the node ingress contract>",
        "networkId": "<ID of your ethereum network>"
}
  1. Use a webserver of your choice to host the contents of the folder as static files directing root requests to index.html

permissioning-smart-contracts's People

Contributors

akuanti avatar albert0-hernandez avatar arash009 avatar errorific avatar francescomiliani avatar joranhonig avatar lucassaldanha avatar macfarla avatar madelinemurray avatar mark-terry avatar taccatisid avatar timbeiko avatar usmansaleem avatar vgloic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

permissioning-smart-contracts's Issues

check for duplicate accounts is case sensitive

eg if 0xfe3b557e8fb62b89f4916b721be55ceb828dbd73 is on the list, adding 0xFE3B557E8Fb62b89F4916B721be55cEb828dBd73 is allowed - but then is rejected because it's already on the list. But rejected after user has already paid for the transaction.

`yarn install` fails

Hello. I followed instructions on this tutorial and failed at "7. Clone the contracts and install dependencies" stage. yarn install gives me errors:

  g++ '-DNODE_GYP_MODULE_NAME=binding' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DBUILDING_NODE_EXTENSION' -I/home/maciek/.node-gyp/16.10.0/include/node -I/home/maciek/.node-gyp/16.10.0/src -I/home/maciek/.node-gyp/16.10.0/deps/openssl/config -I/home/maciek/.node-gyp/16.10.0/deps/openssl/openssl/include -I/home/maciek/.node-gyp/16.10.0/deps/uv/include -I/home/maciek/.node-gyp/16.10.0/deps/zlib -I/home/maciek/.node-gyp/16.10.0/deps/v8/include -I../../nan -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++14 -std=c++0x -MMD -MF ./Release/.deps/Release/obj.target/binding/src/binding.o.d.raw   -c -o Release/obj.target/binding/src/binding.o ../src/binding.cpp
In file included from /home/maciek/.node-gyp/16.10.0/include/node/v8.h:30,
                 from /home/maciek/.node-gyp/16.10.0/include/node/node.h:63,
                 from ../../nan/nan.h:58,
                 from ../src/binding.cpp:1:
/home/maciek/.node-gyp/16.10.0/include/node/v8-internal.h: In function ‘void v8::internal::PerformCastCheck(T*)’:
/home/maciek/.node-gyp/16.10.0/include/node/v8-internal.h:489:38: error: ‘remove_cv_t’ is not a member of ‘std’; did you mean ‘remove_cv’?
  489 |             !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
      |                                      ^~~~~~~~~~~
      |                                      remove_cv
/home/maciek/.node-gyp/16.10.0/include/node/v8-internal.h:489:38: error: ‘remove_cv_t’ is not a member of ‘std’; did you mean ‘remove_cv’?
  489 |             !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
      |                                      ^~~~~~~~~~~
      |                                      remove_cv
/home/maciek/.node-gyp/16.10.0/include/node/v8-internal.h:489:50: error: template argument 2 is invalid
  489 |             !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
      |                                                  ^
/home/maciek/.node-gyp/16.10.0/include/node/v8-internal.h:489:63: error: ‘::Perform’ has not been declared
  489 |             !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
      |                                                               ^~~~~~~
../src/binding.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE render(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/binding.cpp:284:80: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
  284 |     int status = uv_queue_work(uv_default_loop(), &ctx_w->request, compile_it, (uv_after_work_cb)MakeCallback);
      |                                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/binding.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE render_file(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/binding.cpp:320:80: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
  320 |     int status = uv_queue_work(uv_default_loop(), &ctx_w->request, compile_it, (uv_after_work_cb)MakeCallback);
      |                                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../nan/nan.h:58,
                 from ../src/binding.cpp:1:
../src/binding.cpp: At global scope:
/home/maciek/.node-gyp/16.10.0/include/node/node.h:821:7: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
  821 |       (node::addon_register_func) (regfunc),                          \
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/maciek/.node-gyp/16.10.0/include/node/node.h:855:3: note: in expansion of macro ‘NODE_MODULE_X’
  855 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
      |   ^~~~~~~~~~~~~
../src/binding.cpp:358:1: note: in expansion of macro ‘NODE_MODULE’
  358 | NODE_MODULE(binding, RegisterModule);
      | ^~~~~~~~~~~
make: *** [binding.target.mk:129: Release/obj.target/binding/src/binding.o] Błąd 1
make: Opuszczenie katalogu '/mnt/share/prj/x3m/chain/permissioning-smart-contracts/node_modules/node-sass/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/mnt/share/prj/x3m/chain/permissioning-smart-contracts/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Linux 5.13.19-2-MANJARO
gyp ERR! command "/usr/bin/node" "/mnt/share/prj/x3m/chain/permissioning-smart-contracts/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /mnt/share/prj/x3m/chain/permissioning-smart-contracts/node_modules/node-sass
gyp ERR! node -v v16.10.0

On node-sass npm page I read:

Warning: LibSass and Node Sass are deprecated.

Perhaps some dependencies need to be updated?

Clarify the criteria of version field included in the Smartcontracts

The NodeIngresss, NodeRules, AccountIngress and Account Rules contract contains a field named version.
This field in some smartcontracts takes the value equivalent 1.0.0 but in another 3.0.0.

Could you please clarify the criteria of the versioning taking in account that the actual permissioning package is 2.1.X?

Regards

replace whitelist with allowlist in contracts and docs

Moving towards more inclusive language.

  • update smart contracts
  • update UI of dapp
  • update backend logic of dapp
  • deprecate env vars INITIAL_WHITELISTED_ACCOUNTS & INITIAL_WHITELISTED_NODES and README
  • create GI to remove deprecated env vars in next release

Not able to do yarn install

The error is:
An unexpected error occurred: "ENOENT: no such file or directory, open '/home/vic/.cache/yarn/v6/npm-@zondax-filecoin-signing-tools-0.2.0-8f8e92157cac2556d35cab866779e9a8ea8a4e25/node_modules/@zondax/filecoin-signing-tools/.yarn-metadata.json'".

Using yarn version 1.22.5

i did yarn cache clean. still getting the same error.

Add instructions to deploy Permissioning Dapp to IPFS

It could be useful to also add instructions how to configure the package.json in order to successfully deploy the permissioning Dapp to IPFS.
For that purpose the following steps can be taken:

  • clone the repository
  • Add the following line into the package.json
"homepage": ".",
  • Execute: yarn run build ==> build directory is created
  • Use a preferred option like pinata in order to upload the build directory ==> Copy the hash related to the uploaded files
  • Finally visit the uploaded static web page hosted by IPFS by visiting https://gateway.pinata.cloud/ipfs/<hash>/

Problem with `.env` file configuration

Hello.

I follow instructions from Besu's documentation and cannot deploy the contracts to my test node. On yarn truffle migrate --reset I get the error:

yarn run v1.22.11
$ /mnt/share/prj/x3m/chain/permissioning-smart-contracts/node_modules/.bin/truffle migrate --reset

Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.

> Something went wrong while attempting to connect to the network. Check your network configuration.

Could not connect to your Ethereum client with the following parameters:
    - host       > 127.0.0.1
    - port       > 7545
    - network_id > 5777
Please check that your Ethereum client:
    - is running
    - is accepting RPC connections (i.e., "--rpc" option is used in geth)
    - is accessible over the network
    - is properly configured in your Truffle configuration file (truffle-config.js)

Truffle v5.0.44 (core: 5.0.44)
Node v16.10.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Contents of my .env file:

NODE_INGRESS_CONTRACT_ADDRESS=0x0000000000000000000000000000000000009999
ACCOUNT_INGRESS_CONTRACT_ADDRESS=0x0000000000000000000000000000000000008888
BESU_NODE_PERM_ACCOUNT=627306090abaB3A6e1400e9345bC60c78a8BEf57
BESU_NODE_PERM_KEY=c87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3
BESU_NODE_PERM_ENDPOINT=http://<ip of node running Besu>:8545
CHAIN_ID=1337

I've tried also with --network besu option, but then I get another error:

$ yarn truffle migrate --reset --network besu
yarn run v1.22.11
$ /mnt/share/prj/x3m/chain/permissioning-smart-contracts/node_modules/.bin/truffle migrate --reset --network besu

Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.

UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<Object>".
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Execution Reverted in AddEnode from NodeRules.sol

Here is the error

{
    "code": -32000,
    "message": "Execution reverted",
    "data": "0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002a6f6e6c7920746865206c617465737456657273696f6e2063616e206d6f6469667920746865206c69737400000000000000000000000000000000000000000000"
}

Dapp to allow domain names as well as IP

Description

The Dapp should enable the user to use domain names as well as IP addresses to identify p2p clients

Acceptance Criteria

  • Domain names can be added to permit p2p connections
    (Sally reported that this is possible already, but if possible add a test)
  • Make sure that the UI clearly states that IP addresses and DNS can be used

Version v2 of permissioning smart contracts

v2 of permissioning smart contracts will conform to v6 of the EEA client specification.

** Done criteria**

  • get development environment set up to be able to build and run tests
  • clean up some annoying things
  • remove deprecated options in preparation for v2
  • update dependencies
  • Update permissioning contracts
  • Update dapp
  • Test that Besu permissioning still works with nodes added / removed via the updated contracts + dapp
  • Update release notes for v1.1.0 to state it's v1 of the contracts as specified in Besu and conforms to v5 of the EEA spec.
  • Release v2.0 with release notes: that it's v2 of the contracts as specified in Besu and conforms to v6 of the EEA spec.

admins can't send transactions if not on allowlist

If an account is an admin but is not on the account allowlist, there is no way for that admin to modify the allowlist (ie admin can't send transactions). And if they were the only admin, then the only way is to restart the node with permissioning turned off, and add them back in.
Need to change the rules to permit admins to send transactions

Install fails

can't install filecoin-signing-tools-js

yarn install v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
error Command failed.
Exit code: 128
Command: git
Arguments: ls-remote --tags --heads ssh://[email protected]/Digital-MOB-Filecoin/filecoin-signing-tools-js.git
Directory: /home/ptah/permissioning-smart-contracts
Output:
Host key verification failed.
fatal: Could not read from remote repository.

update: issue fixed by running the following:

rm -rf node_modules **/node_modules
rm -rf yarn.lock **/yarn.lock
yarn cache clean
yarn install

but now there is another issue when running yarn run build

yarn run v1.22.19
$ yarn run build:contracts && yarn run build:app
$ yarn truffle compile && yarn typechain --target ethers-v4 --out-dir ./src/chain/@types 'src/chain/abis/*.json'
$ /home/ptah/permissioning-smart-contracts/node_modules/.bin/truffle compile

Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.

$ /home/ptah/permissioning-smart-contracts/node_modules/.bin/typechain --target ethers-v4 --out-dir ./src/chain/@types 'src/chain/abis/*.json'
Successfully generated 37 typings!
$ sh scripts/wrap_env.sh 'yarn react-scripts build'
$ /home/ptah/permissioning-smart-contracts/node_modules/.bin/react-scripts build
Creating an optimized production build...
Failed to compile.

/home/ptah/permissioning-smart-contracts/src/components/AccountTab/Table.tsx
TypeScript error in /home/ptah/permissioning-smart-contracts/src/components/AccountTab/Table.tsx(21,4):
'Box' cannot be used as a JSX component.
  Its element type 'ReactElement<any, any> | Component<BoxProps, any, any> | null' is not a valid JSX element.
    Type 'Component<BoxProps, any, any>' is not assignable to type 'Element | ElementClass | null'.
      Type 'Component<BoxProps, any, any>' is not assignable to type 'ElementClass'.  TS2786

    19 |
    20 | const AccountTable: React.FC<AccountTable> = ({ list, toggleModal, deleteTransaction, isAdmin, isReadOnly }) => (
  > 21 |   <Box mt={5}>
       |    ^
    22 |     <TableContainer component={Paper}>
    23 |       <AccountTableHeader
    24 |         number={list.length}


error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

update:

I could not get the entire project working, so I used truffle to directly deploy the contracts, primarily the "Accounts" one (Windows 11 & VSCode & Node v16.14.2 & HL Besu 22.7.0 & Metamask).

After cloning the project, and opening it in VSCode:
npm install -g truffle

i used "truffle dashboard" to sign the transactions, and this is my truffle-config.js:

const path = require("path");

module.exports = {
  dashboard: {
    host: "localhost",
    port: 24012,
  },
  networks: {
    dashboard: {
      networkCheckTimeout: 120000,
    }
  },

  contracts_build_directory: path.join(__dirname, "src/chain/abis"),

  compilers: {
    solc: {
      version: "0.8.6",
      settings: {
       optimizer: {
         enabled: false,
         runs: 200
       },
      }
    }
  },

  plugins: ['solidity-coverage']
};

run the dashboard (from VSCode terminal) and leave it running

truffle dashboard

it should open the browser and ask to connect to Metamask account (note: Brave browser was not very cooperative, so I used Firefox)

in another terminal, compile the contracts
truffle compile

and then deploy them
truffle migrate --network dashboard

in the dashboard in the browser, you will be asked to sign every transaction, and once all done, you could get all the contract addresses by
truffle networks

now in my case i was only interested in the Account permissions, so i updated the Besu config toml file with the new contract address:

permissions-accounts-contract-address="<new AccountIngress address>"
permissions-accounts-contract-enabled=true

restart the Besu node

Typescript compile error

Using Typescript 3.2.1 (per previous error message saying I needed to downgrade)

Web browser starts up & console says "Files successfully emitted, waiting for typecheck results..."

After five minutes of watching the blue spinning loop on the Besu Permissioning page, I get the following error on both the web browser and the console

Failed to compile.

/mnt/c/Users/markw/permissioning-smart-contracts/node_modules/@babel/types/lib/index.d.ts
TypeScript error in /mnt/c/Users/markw/permissioning-smart-contracts/node_modules/@babel/types/lib/index.d.ts(1450,50):
'{' or ';' expected. TS1144

1448 | }): ReturnedChild[];
1449 |

1450 | declare function assertNode(node?: any): asserts node is Node;
| ^
1451 |
1452 | declare function assertArrayExpression(node: object | null | undefined, opts?: object | null): asserts node is ArrayExpression;
1453 | declare function assertAssignmentExpression(node: object | null | undefined, opts?: object | null): asserts node is AssignmentExpression;

Clarification on Different IP Addresses for Node Ingress and Egress

Some k8s implementation use two different addresses for ingress and egress:

  1. Load balancer IP address (ingress)
  2. NAT gateway IP address (egress)

In our tests, when whitelisting the node only with the load balancer's IP, the node couldn't connect to the network, as the IP address that was being used by the node when trying to connect to the boot nodes, was the NAT gateway's IP, which wasn't whitelisted.
Next, we tried whitelisting the same public key twice, once with the load balancer's IP and once with the NAT gateway's IP, and that solve the problem.

My question is whether you foresee any possible issues that by arise by using such a work around?

Can't deploy smart contracts

I created .env file following this guide and tried to deploy smart contracts with yarn truffle migrate --reset, and I got this error:

image

The script simply couldn't load environment variables. I've tried to set them right in the truffle-config.js, but it unfortunately didn't help.

Could you explain, what I'm doing wrong?

P.S. Setup config: I have deployed besu on server (not locally) as it had been written in the guide.

Fail "yarn run build"

Hello everybody,

I follow instructions from Besu's documentation and as soon as I try to do the build, it fails.

But first I update Typescript to the latest version (^4.8.4) withyarn add typescript @types/latest-version otherwise it returns an Error Type Excepted.

After that, when i try to do the build yarn run build, i get the error:

TypeScript error in C:/Users/ricca/Desktop/Besu/Permissioned-Onchain/permissioning-smart-contracts-2.1.6/src/components/AccountTab/Table.tsx(21,4):   
'Box' cannot be used as a JSX component.
  Its element type 'ReactElement<any, any> | Component<BoxProps, any, any> | null' is not a valid JSX element.  TS2786

   19 | 
   20 | const AccountTable: React.FC<AccountTable> = ({ list, toggleModal, deleteTransaction, isAdmin, isReadOnly }) => (
 > 21 |   <Box mt={5}>
      |    ^
   22 |     <TableContainer component={Paper}>
   23 |       <AccountTableHeader
   24 |         number={list.length}


error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

For information, I use these versions:

node --version 
v16.17.0 
yarn --version 
1.22.19

Can anyone tell me how i can fix this error?

Update

To resolve the previous error I updated React: yarn add react@18 react-dom@18 @types/react@18 @types/react-dom@18

I think the previous error is gone, but when i try to redo the build yarn run build, i get another error:

TypeScript error in C:/Users/ricca/Desktop/Besu/Permissioned-Onchain/permissioning-smart-contracts-2.1.6/src/App.tsx(24,4):
Type '{ children: Element; config: Config; }' is not assignable to type 'IntrinsicAttributes & { config: Config; }'.
  Property 'children' does not exist on type 'IntrinsicAttributes & { config: Config; }'.  TS2322

    22 | 
    23 | const App: React.FC<{ config: Config }> = ({ config }) => (
  > 24 |   <ConfigDataProvider config={config}>
       |    ^
    25 |     <ThemeProvider theme={createTheme(theme)}>
    26 |       <NetworkProvider>
    27 |         <Layout>


error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Can anyone fix this other error please?

Detach node storage from rules

When the permissioning smart contract is upgraded, the allow list entries must be reloaded into the upgraded contract. Detaching the data in a way that allows the contract to be upgraded without losing the data would be a better user experience.

Archive this repo

This repository is being archived.

You can still use onchain permissioning with [Besu](https://besu.hyperledger.org/en/stable/Tutorials/Permissioning/Getting-Started-Onchain-Permissioning/ - will remove references there to the dapp) however we do not plan to further develop either the specific implementation of these contracts or the dapp that is contained in this repository.

Additionally, due to outdated dependencies, the instructions in the README to build and run the dapp may not work for new users (only work for existing users).

Update JS dependencies

Many packages are out of date. Need to update lots of things.

  • web3
  • ethers
  • jest
  • mocha-junit
  • replace Rimble UI -> Material UI
  • husky
  • prettier
  • typechain
    These libraries can't be updated right now:
  • react & react-dom
  • truffle
  • typescript

Detach Account allowlist data from permissioning contract

When the permissioning smart contract is upgraded, the allow list entries must be reloaded into the upgraded contract. Detaching the data in a way that allows the contract to be upgraded without losing the data would be a better user experience.

Add labels to allowlist entries

When the allow lists (both accounts and nodes) grow, it's difficult to tell which enode corresponds to each ethereum node. Adding a string label to each item in the allowlist (along with the enode or account address) would make easier for the administrators to maintain (add/revoke) the entries in the allow lists.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.