maxsam4 / fork-off-substrate Goto Github PK
View Code? Open in Web Editor NEWThis script allows bootstrapping a new substrate chain with the current state of a live chain
License: MIT License
This script allows bootstrapping a new substrate chain with the current state of a live chain
License: MIT License
Follow the README and show such logs. I have no idea why the finalized block is 0 all the time. Does anyone know what happened here?
$ ./binary --chain fork.json --alice
2022-04-22 15:44:56 👶 Creating empty BABE epoch changes on what appears to be first startup.
2022-04-22 15:44:56 🏷 Local node identity is: 12D3KooWF6hM2mHQf5U8AtyhCvB2RvdY5S4NxQuRfVptYY9JRrSQ
2022-04-22 15:44:56 Can't listen on /ip6/::/tcp/30333 because: Other(Custom { kind: Other, error: Other(A(A(A(A(Transport(B(Os { code: 98, kind: AddrInUse, message: "Address already in use" }))))))) })
2022-04-22 15:44:56 Can't listen on /ip4/0.0.0.0/tcp/30333 because: Other(Custom { kind: Other, error: Other(A(A(A(A(Transport(B(Os { code: 98, kind: AddrInUse, message: "Address already in use" }))))))) })
2022-04-22 15:44:57 📦 Highest known block at #0
2022-04-22 15:44:57 Unable to bind RPC server to 127.0.0.1:9933. Trying random port.
2022-04-22 15:44:57 Unable to listen on 127.0.0.1:9944
2022-04-22 15:44:57 Unable to bind RPC server to 127.0.0.1:9944. Trying random port.
2022-04-22 15:44:57 Listening for new connections on 127.0.0.1:41053.
2022-04-22 15:44:57 👶 Starting BABE Authorship worker
2022-04-22 15:45:02 💤 Idle (0 peers), best: #0 (0x5b7b…dbe6), finalized #0 (0x5b7b…dbe6), ⬇ 134.9kiB/s ⬆ 20.1kiB/s
2022-04-22 15:45:07 💤 Idle (0 peers), best: #0 (0x5b7b…dbe6), finalized #0 (0x5b7b…dbe6), ⬇ 130.7kiB/s ⬆ 9.5kiB/s
2022-04-22 15:45:12 💤 Idle (0 peers), best: #0 (0x5b7b…dbe6), finalized #0 (0x5b7b…dbe6), ⬇ 41.8kiB/s ⬆ 4.7kiB/s
2022-04-22 15:45:17 💤 Idle (0 peers), best: #0 (0x5b7b…dbe6), finalized #0 (0x5b7b…dbe6), ⬇ 100.2kiB/s ⬆ 7.4kiB/s
2022-04-22 15:45:22 💤 Idle (0 peers), best: #0 (0x5b7b…dbe6), finalized #0 (0x5b7b…dbe6), ⬇ 0.8kiB/s ⬆ 0.8kiB/s
2022-04-22 15:45:27 💤 Idle (0 peers), best: #0 (0x5b7b…dbe6), finalized #0 (0x5b7b…dbe6), ⬇ 0.8kiB/s ⬆ 0.7kiB/s
2022-04-22 15:45:32 💤 Idle (0 peers), best: #0 (0x5b7b…dbe6), finalized #0 (0x5b7b…dbe6), ⬇ 111.5kiB/s ⬆ 7.3kiB/s
2022-04-22 15:45:37 💤 Idle (0 peers), best: #0 (0x5b7b…dbe6), finalized #0 (0x5b7b…dbe6), ⬇ 3.7kiB/s ⬆ 1.0kiB/s
2022-04-22 15:45:42 💤 Idle (0 peers), best: #0 (0x5b7b…dbe6), finalized #0 (0x5b7b…dbe6), ⬇ 0.1kiB/s ⬆ 0.1kiB/s
When I run npm start
with a Polkadot archive node locally, it results in:
node:buffer:593
slice: (buf, start, end) => buf.utf8Slice(start, end),
^
Error: Cannot create a string longer than 0x1fffffe8 characters
at Object.slice (node:buffer:593:37)
at Buffer.toString (node:buffer:811:14)
at Object.readFileSync (node:fs:497:41)
at main (/home/vados/fork-off-substrate/index.js:123:31)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
code: 'ERR_STRING_TOO_LONG'
}
NodeJS only allows for strings to be 512 MiB, currently the state of Polkadot seems to be larger that that.
Example file.
There are some async parsing libs, but they are slow and I dont know how to write the state back to disk with them either...
➜ fork-off-substrate git:(master) npm start
> [email protected] start /home/dylan/Projects/fork-off-substrate
> node index.js
We are intentionally using the HTTP endpoint. If you see any warnings about that, please ignore them.
2022-02-16 18:34:11 API/INIT: Api will be available in a limited mode since the provider does not support subscriptions
2022-02-16 18:34:11 API/INIT: Error: FATAL: Unable to initialize the API: Cannot convert undefined or null to object
at ApiPromise.value (/home/dylan/Projects/fork-off-substrate/node_modules/@polkadot/api/base/Init.cjs:88:25)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
Any idea what this means?
Unable to author block in slot 270671004,. `can_author_with` returned: `spec_name` does not match `Darwinia` vs `Crab` Probably a node update is required!
I tried to run this script, but I found I can only backup the current state, all the blocks since block 1 in the fork chain are different with the original chain, just want to make sure can this script backup the whole blockchain?
✗ HTTP_RPC_ENDPOINT=http://office.nkg:20000 npm start
> fork-off-substrate@1.0.0 start /home/xavier/Documents/paritytech/fork-off-substrate
> node index.js
We are intentionally using the HTTP endpoint. If you see any warnings about that, please ignore them.
2021-03-02 12:18:28 API/INIT: Api will be available in a limited mode since the provider does not support subscriptions
2021-03-02 12:18:28 API-HTTP: HTTP Provider does not have 'on' emitters, use WebSockets instead
2021-03-02 12:18:28 API-HTTP: HTTP Provider does not have 'on' emitters, use WebSockets instead
2021-03-02 12:18:28 API-HTTP: HTTP Provider does not have 'on' emitters, use WebSockets instead
2021-03-02 12:18:29 API/INIT: RPC methods not decorated: balances_usableBalance, headerMMR_genProof, staking_powerOf
Unable to resolve type Status, it will fail on construction
Unknown signed extensions CheckEthereumRelayHeaderParcel found, treating them as no-effect
Unknown types found, no types for Status
Fetching current state of the live chain. Please wait, it can take a while depending on the size of your chain.
/home/xavier/Documents/paritytech/fork-off-substrate/node_modules/node-fetch/lib/index.js:272
return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
^
FetchError: invalid json response body at http://office.nkg:20000/ reason: Cannot create a string longer than 0x1fffffe8 characters
at /home/xavier/Documents/paritytech/fork-off-substrate/node_modules/node-fetch/lib/index.js:272:32
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:94:5)
at async HttpProvider.send (/home/xavier/Documents/paritytech/fork-off-substrate/node_modules/@polkadot/rpc-provider/http/index.js:149:20)
at async main (/home/xavier/Documents/paritytech/fork-off-substrate/index.js:65:17) {
type: 'invalid-json'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/xavier/.npm/_logs/2021-03-02T04_22_46_261Z-debug.log
Tried this on latest westend and I'm getting errors related to unknown types
2021-05-13 08:14:50 API/INIT: Api will be available in a limited mode since the provider does not support subscriptions
2021-05-13 08:14:51 REGISTRY: Unable to resolve type Outcome, it will fail on construction
2021-05-13 08:14:51 REGISTRY: Unable to resolve type PalletId, it will fail on construction
2021-05-13 08:14:51 REGISTRY: Error: Cannot construct unknown type PalletId
2021-05-13 08:14:51 API/INIT: Error: FATAL: Unable to initialize the API: createType(PalletId):: Cannot construct unknown type PalletId
2021-05-13 08:14:51 API/INIT: Error: createType(PalletId):: Cannot construct unknown type PalletId
Hey,
I'm trying to get fork-off-substrate to work with https://github.com/edgeware-network/edgeware-node/tree/erup-5-latest.
I assume it's because I have not added the custom types but, I have imported them into the index.js file(const { spec } = require('@edgeware/node-types');) and that should work. Am I missing something here that causes problems?
HTTP_RPC_ENDPOINT=http://mynode:9988 npm start
> [email protected] start
> node index.js
We are intentionally using the HTTP endpoint. If you see any warnings about that, please ignore them.
Custom Schema missing, using default schema.
2022-07-26 22:54:26 API/INIT: Api will be available in a limited mode since the provider does not support subscriptions
2022-07-26 22:54:27 API/INIT: RPC methods not decorated: contracts_upload_code, dev_getBlockStats, eth_feeHistory, eth_maxPriorityFeePerGas
2022-07-26 22:54:27 API/INIT: Error: FATAL: Unable to initialize the API: Cannot convert undefined or null to object
at ApiPromise.value (/fork-off-substrate/node_modules/@polkadot/api/base/Init.cjs:88:25)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Custom types imported:
https://github.com/hicommonwealth/edgeware-node-types
Hello!
I'm a member of the Kusama Society and we are developing a dedicated interface as a development plan for the society. We want to create some integration tests and for that we want to run a development node reflecting the state of Society members at some point in time.
I'm trying to run a development chain forked off from Kusama. So far I synched an archived node and created the fork against said node. Apparently all went well, but I'm unable to produce blocks and execute extrinsics. I suppose it's because the chain is waiting for the current Kusama validator set. How do I change the validator set and get control over the chain?
I tried editing fork.json
but I don't understand its structure.
I got error message like this when I tried exporting chain state following the readme:
etching current state of the live chain. Please wait, it can take a while depending on the size of your chain.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0% | ETA: 0s | 0/256(node:564735) UnhandledPromiseRejectionWarning: Error: -32603: Unknown error occurred: Ur
at RpcCoder._checkError (/home/bear/working/darwinia/fork-off-substrate/node_modules/@polkadot/rpc-provider/coder/index.cjs:84:13)
at RpcCoder.decodeResponse (/home/bear/working/darwinia/fork-off-substrate/node_modules/@polkadot/rpc-provider/coder/index.cjs:47:10)
at HttpProvider.send (/home/bear/working/darwinia/fork-off-substrate/node_modules/@polkadot/rpc-provider/http/index.cjs:150:76)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async fetchChunks (/home/bear/working/darwinia/fork-off-substrate/index.js:135:19)
at async fetchChunks (/home/bear/working/darwinia/fork-off-substrate/index.js:153:7)
at async main (/home/bear/working/darwinia/fork-off-substrate/index.js:81:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:564735) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function with)
(node:564735) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will t.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.