harpagon210 / steemsmartcontracts Goto Github PK
View Code? Open in Web Editor NEWjavascript blockchain/sidechain powered by Steem
Home Page: https://github.com/harpagon210/steemsmartcontracts/wiki
License: MIT License
javascript blockchain/sidechain powered by Steem
Home Page: https://github.com/harpagon210/steemsmartcontracts/wiki
License: MIT License
Is there anyway to integrate with Visual Studio Code for suggestions? Regarding smart contract available APIs. Is there an npm package that contains the definitions for available APIs?
Tools should be provided so that contracts are able to do stateless validation of account names (without lookup), identical to the mainnet:
As a private node operator, I would like to build the sidechain with my own local steemd
node (without a third party blocks.log
file), so that I can verify the sidechain.
The problem is that, by default, it now takes about three days to rebuild the sidechain using nothing but steemd
as a source for transactions. This will only get longer over time.
It is possible to reduce the replay time from three days to about 8 hours if you modify the source code:
steemsmartcontracts/libs/Streamer.js
Line 12 in 1856691
steemsmartcontracts/plugins/Streamer.js
Line 256 in bffa07a
So, normally, when it's all caught up, 200 (libs) and 100 (plugins) seems fine (as addressed in issue: #18). But when rebuilding the entire sidechain from steemd
, pooling takes too long.
For example, if the polling time is modified to 20/10, this significantly reduces the time it takes to rebuild the sidechain from steemd
. However, I am not suggesting that we change these polling times to something static. Instead, I'm recommending that it become calculated, based on how far behind main chain streaming is.
As a private node operator, I would like to be able to stop my node cleanly, so I don't have to worry that config.json
is wrong.
Most of the time, when a node is running perfectly normal for hours or days (npm run start
), when using ^C
to stop the node, config.json
is not saved with the correct value in startSteemBlock
. If the node operator does not catch this situation, they're likely to start the node again and end up with duplicate blocks.
As a token issuer, I would like to be able to express a batch of contract actions, so that I can get around one-block-per-account-per-custom-json.
The condition in question is:
steemsmartcontracts/plugins/Streamer.js
Lines 80 to 82 in 4a22259
E.g., a second case for when contractPayload === 'list'
(I think?). Or just make single-actions become one-element batches directly outside this condition.
Preferred example:
{
"required_auths":[
"inertia"
],
"required_posting_auths":[
],
"id":"ssc-00000000000000000002",
"json":"[{\"contractName\":\"tokens\",\"contractAction\":\"issue\",\"contractPayload\":{\"symbol\":\"SPAMMY\",\"to\":\"mack-bot\",\"quantity\":0.00139503,\"memo\":\"@chucha530/6o2xgq\"}},{\"contractName\":\"tokens\",\"contractAction\":\"issue\",\"contractPayload\":{\"symbol\":\"SPAMMY\",\"to\":\"prowler\",\"quantity\":8.4e-07,\"memo\":\"@chucha530/6o2xgq\"}},{\"contractName\":\"tokens\",\"contractAction\":\"issue\",\"contractPayload\":{\"symbol\":\"SPAMMY\",\"to\":\"spaminator\",\"quantity\":0.9972102,\"memo\":\"@chucha530/6o2xgq\"}}]"
}
Notice, I'm passing an array ([]
) to json
that contains three actions, instead of a single object ({}
) with a single action.
As a private node operator, I would like to build the sidechain with my own local steemd
node (without a third party blocks.log
file), so that I can verify the sidechain.
The problem is that, by default, it will currently take about 60 hours to rebuild the sidechain using nothing but steemd
as a source for transactions. This will only get longer over time.
This is complicated by the fact that we run out of memory after 24 hours, if we attempt to leave the node running that long. I believe there's a problem setting both of the following to 100
milliseconds ...
steemsmartcontracts/libs/Streamer.js
Line 12 in 775f20a
steemsmartcontracts/libs/Streamer.js
Lines 99 to 101 in 775f20a
steemsmartcontracts/plugins/Streamer.js
Line 196 in 0341df4
The problem is, if libs/Streamer.js
manages to get ahead of plugins/Streamer.js
, it will take more and more memory until it runs out.
I agree with the intent of 775f20a to speed up streaming. But making the two equal introduces a complication.
One might think, there's no way they could get ahead of each other because they both wait 100 milliseconds. But if plugins/Streamer.js
processing takes even 1 millisecond longer than libs/Streamer.js
, libs/Streamer.js
will start to retain more and more blocks in its queue, over time.
If we are only 10,000 blocks behind, that's no problem. But if we are 30,000,000 blocks behind, after 24 hours, the node will crash.
I propose that libs/Streamer.js
polling time should always be twice as long as plugins/Streamer.js
polling time.
Trying to do a school project and I notice no way generate genesis block into blocks.log other than getting the blocks log file from you. Why can it not by default generate in the file.
When running replay it will stack the data in the data folder if you already have a data folder.
Something should be added to clear the data folder on replay. That or added to the guide to tell people to remove the data folder every time they replay.
Edit: Actually it should cycle through for duplicates and ignore the duplicates and only submit the data for missing blocks.
As a private ssc node operator, I would like to ensure that all block numbers have the same hash on all nodes, so that I can ensure each node has deterministically built the same sidechain (for a given chain-id).
The tender project has a rake task to verify the blockchain and build a list of block numbers and corresponding block hashes. An example of this can be seen here:
https://steem-engine.rocks/checkpoints
The checkpoints in the above screen capture were built on a private node running b4885fd.
However, when checking if these checkpoints match against another node, they do not always match. In this example, they match block zero, but after block 10000
, they no longer match.
When running this check on a block-by-block granularity, checkpoints diverge at block 4999
where my private node has trx_id 1c57afb2574791e5564c2394b7532cb7d8730a7e
but the public node has trx_id 1c57afb2574791e5564c2394b7532cb7d8730a7e-0
.
AC
As a token issuer that has the ability to deploy/edit contracts, I would like SSC to reject deploy/edit attempts unless I have also provided a custom_json
that unlocks this ability, so that if my posting key is compromised, my contracts cannot be vanalized.
When steemd
introduced unlimited comment edit, the blockchain engineers considered adding a way to enable this feature for accounts that broadcasted a special op to enable edits, signed by the active key (see: steemit/steem#1017). This idea was later dropped.
In HF18, the witness plugin had a custom operation called enable_content_editing
that allowed a user to signal they want to edit their content. By consensus, content was editable indefinitely, but was soft forked to be frozen after payout. This operation required an active key and was designed to prevent vandalism if a posting key was compromised.
Now, we have SSC with the ability to deploy/edit contracts using the posting key. I believe some kind of lock/unlock action would be useful to allow token issuers to secure their contracts.
The token issuer could broadcast the custom_json
using the active key with a timestamp to indicate 10 minutes in the future, 3 days in the future, or whatever time makes sense for contract deploy. After that, contracts are locked until another custom_json
using the active key unlocks it for later deploy/edits.
In my opinion, the urgency is low for the moment, because Steem Engine does not support general contract deployment. As long as Steem Engine properly secures their posting key, there's no danger in contract vandalism.
But in the future, when an SSC product like Steem Engine does open up general contract deployment, I believe a solution like this should be in place.
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.