Author

Topic: Slimcoin | First Proof of Burn currency | Decentralized Web - page 133. (Read 137076 times)

legendary
Activity: 2254
Merit: 1290
It has an elevated reservebalance level and a blocknotify script specialised to testnet.

“What blocknotify script?” asks a hypothetical discourse device. Well, the client can be configured to execute a specified program whenever the client receives a new block.

In my slimcoin_testnet.conf it is configured as a shell script:
Code:
blocknotify=/opt/slm/scripts/slm-testnet-blocknotify.sh %s

when executed, the %s gets replaced by the actual block hash, bound in the shell environment to $@.

The shell script:
Code:
#!/bin/sh
BLOCKHASH="$@" /usr/bin/python3.5 /opt/slm/scripts/slm-testnet-blocknotify.py  > /tmp/blocknotify.log 2>&1
echo "${@}" >> /tmp/blocknotify.log

which, in turn, runs a Python script that picks up the block hash from the environment, performs a series of RPC calls on the client, starting with getblock , converting the returned JSON statements into RDF statements and working its way through the pointers finally to create an complete RDF graph representation of the block, its transactions, their values and the addresses involved. It records around three dozen facts about each block.

(~950000 blocks * 36 triples = 34,200,000 triples, so an RDF graph of mainnet will a) take time to generate and b) have to be maintained in separate chunks. Fortunately SPARQL can run “federated” queries, i.e. treat the separate chunks as one for querying porpoises.)

The RDF is then posted to an instance of the Apache Jena Fuseki SPARQL server running on the (same) machine which then offers SPARQL querying of a contemporaneous RDF graph of the blockchain.

The following image shows a SPARQL query that lists all distinct OP_RETURN tx messages on the testnet blockchain:



(The SPARQL endpoint shown in the image is active and accessible)

That's all she wrote, literally.  If we want to provide more information about a particular inscription, such as a description of the nature of the content of the torrent identified by the inscribed torrent hash, then for us it has to be off-chain.

Off-chain data storage is often implemented by creating additional data tables in the -datadir. Unfortunately, this approach also adds significantly to the maintenance load and this directly translates into a significant increase in the cost of ownership for the already woefully under-supported user. Let’s be realistic, people aren't exactly queuing up to shoulder the load of curating the content that they create in the course of their netsocializing, they much prefer it to be someone else's problem even at the price of a significant concession of privacy.

The real show-stopper is that the locally-stored data isn't broadcast across the peer-to-peer network, it remains locally siloed and thus useful to neither man nor beast.

A more plausible approach would be to engineer a reliable external social consensus using an RDF graph representation of the blockchain for provable veracity. The RDF representation is both public and accessible so it's trivial to establish whether or not it's a correct mapping from the acyclic directed blockchain graph to the acyclic directed RDF graph.

Given that the RDF graph is a one-to-one symbolic correspondence to the blockchain, referring to :C0000000733567067927d0778bdee1ad3034ecc60e49cfc3ae05dbc3a1eddbb60 will get you the recorded metadata for that block:


:C0000000733567067927d0778bdee1ad3034ecc60e49cfc3ae05dbc3a1eddbb60 a :Block ;
    :difficulty 0.06464541 ;
    :flags "proof-of-work"^^xsd:string ;
    :height 759 ;
    :mint 6.19 ;
    :previousblockhash :C8fe77bb34c5aec9206a3c73beccaf1fc53e6d4afe297c3782f57c09e4eb9c627 ;
    :size 355 ;
    :time 1492346152 .


The absence of a statement about the nextblock defines this as the last block in the chain at the time recorded.

So, given that the query:

SELECT ?subject
WHERE {
  ?subject rdf:type .
  ?subject "magnet:?xt=urn:btih:e940a7a57294e4c98f62514b32611e38181b6cae"
}


yields a reference to the TxO

I can make further statements, using the retrieved TxO reference as an identifier and using expressions drawn from familiar vocabularies (in this instance, for clarity I'm using just the Dublin Core metadata elements):

:gjh-00000001 a :Inscription ;
  :inscription  "magnet:?xt=urn:btih:e940a7a57294e4c98f62514b32611e38181b6cae"^^xsd.string ;
  dc:title "Arch Linux 2013.01.04 (www.archlinux.org)"^^xsd.string ;
  dc:date 2013-01-04T22:09:20Z ;
  dc:identifier http://purl.org/net/bel-epa/ccy#C1887d7380f770c99c0f9d08c38b7f01d71913b2ce791d1771ddfcfddda69f49d-O-2 ;
  dc.source: "magnet:?xt=urn:btih:c8cde7428b44142b04d88b91785ecf0f20d16903&dn=archlinux-2013.02.01-x86_64.iso&tr=udp://tracker.archlinux.org:6969&tr=http://tracker.archlinux.org:6969/announce" ;
  dc:description "kernel_version 3.6.11"^^xsd.string .


I can add that to my local graph, dump it on pastebin or, one day in the dim and distant future, I could even publish it to a group-maintained community-serving RDF graph running on several DO/AWS instances so that other users can choose to add to their whitelisted resources.


Cheers

Graham
legendary
Activity: 2254
Merit: 1290
Successfully compiled and running a Mac OS GUI.  Now let's play with the OP_RETURN thingie...

Good to know, thanks.

Background reading: Bartoletti and Pompianu's paper (reporting Feb '17 results) “An analysis of Bitcoin OP RETURN metadata. Massimo Bartoletti and Livio Pompianu, Universit`a degli Studi di Cagliari, Cagliari, Italy” (PDF), presented at Financial Cryptography and Data Security April 2017.

Latest commit:

https://github.com/slimcoin-project/Slimcoin/commit/05ee8c0a879afa3263a1b348a94e8a98e87206db - “Show OP_RETURN message in transaction details”



Note, cost of creating an OP_RETURN tx has doubled (from 0.01 SLM to 0.02 SLM) - it transpires that 0-valued tx are prohibited as a hard-coded element of the consensus mechanism

https://github.com/slimcoin-project/Slimcoin/blob/slimcoin/src/main.cpp#L587

Code:
if ((!txout.IsEmpty()) && txout.nValue < MIN_TXOUT_AMOUNT)
    return DoS(100, error("CTransaction::CheckTransaction() : txout.nValue below minimum"));

Changing this to allow 0-valued tx would create a ... hard fork. Old clients would be peremptorily excluded from any new, 0-valued-tx-tolerant consensus and that would be a bummer.

So instead, I adjusted the OP_RETURN tx generation code to add a 0.01 CENT value to the tx, which enables it to be accepted as a valid tx by legacy 0.3/0.4 clients as well as the 0.5 johnny-come-latelys.

NOTE: TESTNET ONLY PLEASE I've removed the “enforced testnet mode” from the code, so there's every opportunity to be a good Slimcitizen and use -testnet when experimenting. I create a copy of ~/.slimcoin/slimcoin.conf as ~/.slimcoin/slimcoin_testnet.conf and reference that specifically on the command line: ./slimcoin-qt -testnet -conf=slimcoin_testnet.conf. It has an elevated reservebalance level and a blocknotify script specialised to testnet.

Testnet seed node (1 thread devoted to mining just to keep the blockchain ticking over): addnode=144.76.64.49:41684, PM me for testnet coins.


Cheers

Graham

Edit: addeddaddnodde
member
Activity: 98
Merit: 10
Successfully compiled and running a Mac OS GUI.  Now let's play with the OP_RETURN thingie...
legendary
Activity: 2254
Merit: 1290
I'll update the repos: https://github.com/gjhiggins/ansible-slm-jessie with a known-to-work version.

Now known to work reliably, chapter and verse on building for Debian Jessie Vagrant VM.

Cheers

Graham
legendary
Activity: 2254
Merit: 1290

yes, googled this too - but no solution suggested.. will try to build on Ubuntu VM and move to Debian

You may not need to go down that route. Fortunately, I am unable to replicate the issue. I have a Vagrant VM of Jessie on which Slimcoin master compiles, the GUI executes and all tests pass.

I can't give you chapter and verse just yet. I was working on a Vagrant+ansible Jessie deployment but abandoned it, upgrading to the desktop for convenience - that's where I built the Jessie binaries.

I'll update the repos: https://github.com/gjhiggins/ansible-slm-jessie with a known-to-work version.

Cheers

Graham
full member
Activity: 222
Merit: 103

yes, googled this too - but no solution suggested.. will try to build on Ubuntu VM and move to Debian
legendary
Activity: 2254
Merit: 1290
Debian 8 x64 - still crashing with:

Code:
from src/bitcoinrpc.cpp:8:
src/bignum.h:52:24: error: invalid use of incomplete type ?BIGNUM {aka struct bignum_st}?
 class CBigNum : public BIGNUM

Known bug with Debian 8 apparently: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=855574

Cheers

Graham
full member
Activity: 222
Merit: 103
Debian 8 x64 - still crashing with:

Code:
from src/bitcoinrpc.cpp:8:
src/bignum.h:52:24: error: invalid use of incomplete type ?BIGNUM {aka struct bignum_st}?
 class CBigNum : public BIGNUM
newbie
Activity: 14
Merit: 0
after i put the content of slm-datadir-blockfiles.zip in datadir , i cant check wallet or do something , it says: "blockchain download required" , there is a way to fix it?

Blockfiles created by a Linux-hosted client may not work for a Windows-hosted client. At worst, shut down the client, delete everything in datadir (except wallet.dat, ofc) and then re-start the client - it should synch from the network.

Other than that, somewhere in the previous posts around Dec/Jan there was a Windows blockchain dump for Slimcoin made available which should cut down the syncing time. I hope you'll forgive me for not providing a precise reference, Real Life(tm) is calling.

Cheers

Graham



Im using ubuntu 16.04 , not windows
legendary
Activity: 2254
Merit: 1290
after i put the content of slm-datadir-blockfiles.zip in datadir , i cant check wallet or do something , it says: "blockchain download required" , there is a way to fix it?

Blockfiles created by a Linux-hosted client may not work for a Windows-hosted client. At worst, shut down the client, delete everything in datadir (except wallet.dat, ofc) and then re-start the client - it should synch from the network.

Other than that, somewhere in the previous posts around Dec/Jan there was a Windows blockchain dump for Slimcoin made available which should cut down the syncing time. I hope you'll forgive me for not providing a precise reference, Real Life(tm) is calling.

Cheers

Graham
full member
Activity: 130
Merit: 100
For a coin with so many heavy hitters this seems ignored. But also unobtainable for a person who does not mine? No exchanges?

It is traded on Novaexchange: https://novaexchange.com/market/BTC_SLM/

Though you can still easily mine a few coins from within the wallet and the increase your holdings by burning and staking.

HTH

Is the original dev still involved?
member
Activity: 98
Merit: 10
It means the blockchain wasn't downloaded or it's in a different location than the one expected. Have a look again at the explanation of Graham above and try to follow closely those steps.
newbie
Activity: 14
Merit: 0
after i put the content of slm-datadir-blockfiles.zip in datadir , i cant check wallet or do something , it says: "blockchain download required" , there is a way to fix it?
legendary
Activity: 1612
Merit: 1608
精神分析的爸
For a coin with so many heavy hitters this seems ignored. But also unobtainable for a person who does not mine? No exchanges?

It is traded on Novaexchange: https://novaexchange.com/market/BTC_SLM/

Though you can still easily mine a few coins from within the wallet and the increase your holdings by burning and staking.

HTH
sr. member
Activity: 462
Merit: 250
For a coin with so many heavy hitters this seems ignored. But also unobtainable for a person who does not mine? No exchanges?
legendary
Activity: 2254
Merit: 1290
after download the  blockchain, posted by Graham https://minkiz.co/noodlings/slm/slm-datadir-blockfiles.zip , where i need to put the files?

The intended location for the block files in slm-datadir-blockfiles.zip is wherever datadir is configured to be.

datadir is the (individually-configurable) location of the standard set of data files and sub-directories that are automatically created when the app is first run i.e. peers.dat, wallet.dat, debug.log, blk00001.dat,  database/, etc.

(The command-line option -datadir= is how a non-default location for the data files is specified: https://en.bitcoin.it/wiki/Running_Bitcoin)

By default, datadir is located in the user's home directory (commonly aliased as HOME or ~).

The default datadir values are hard-coded - https://github.com/slimcoin-project/Slimcoin/blob/master/src/util.cpp#L861
Code:
    // Windows: C:\Documents and Settings\username\Application Data\SLIMCoin
    // Mac: ~/Library/Application Support/SLIMCoin
    // Unix: ~/.slimcoin

The content of the zip archive is reported as:
Code:
gjh@ashpool:~/.slimcoin$ unzip -l slm-datadir-blockfiles.zip 
Archive:  slm-datadir-blockfiles.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
510494780  2017-03-28 01:17   blk0001.dat
611368960  2017-03-28 01:17   blkindex.dat
        0  2017-03-28 01:07   database/
 10485759  2017-03-28 01:17   database/log.0000010055
---------                     -------
1132349499                     4 files

(Yes, sorry, 28th March is correct. I did set up a scheduled task to refresh it daily but it just fails and I haven't yet figured out why).

Finally, the answer:

Copy slm-datadir-blockfiles.zip to your datadir and unzip the archive in place, i.e. the contents will be written to datadir.

(In due course, when I've learned to pronounce correctly the spell of create-slimcoin-readable-bootstrap.dat, I will publish a bootstrap.dat at reasonably frequent intervals but until then, all I can manage is a stammered “cd ~/.slimcoin; zip -r slm-datadir-blockfiles.zip blk* database” which is rather crude but at least it's known to work on Linux and OS X platforms.)

Cheers

Graham
newbie
Activity: 14
Merit: 0
after download the  blockchain, posted by Graham https://minkiz.co/noodlings/slm/slm-datadir-blockfiles.zip , where i need to put the files?
legendary
Activity: 3906
Merit: 6249
Decentralization Maximalist
AIUI, this is on Ubuntu Trusty? Is that on a 32-bit or 64-bit architecture?

The VPS has Ubuntu Trusty 32-bit. I just compiled the latest master code (g9d111bc9) on my other machine with a newer 64-bit Linux (PCLinuxOS, a rolling release distribution) and there the crash (until now) does not occur and it seems to sync well. Maybe the VPS (32-bit) crash is also related to my VPS being low-end (512 MB RAM + 1,5 GB swap) but it worked reasonably well with earlier Slimcoin versions of the 0.3 and 0.4 branches (except the sync problems I mentioned earlier).

Quote
Now that the dust is beginning to settle on the codebase, we can switch the default github repos back to "master" and use the 0.5 tag to distinguish the supported Linux “0.5 release” build and use the release page to offer downloadable 0.5 binaries for Windows and OS X. Then we can return to the standard “developers work in their own branch” approach. The current “slimcoin” branch can simply be renamed to “slimcoin 0.4”.

Sounds good for me.

I'm not familiar with Vagrant and Ansible but the features you mention look good too. I'll try to take a look at it.

Thank you for your work!

PS: Dark Star made me curious, will see if I can get a version with spanish or german subtitles Wink
legendary
Activity: 2254
Merit: 1290
When compiling the daemon, just use the standard make -f makefile.unix

Thanks! The compilation works now with Boost 1.54. Unfortunately, the daemon still crashes (segfaults) about ~10 minutes after startup (as before, last sign of life in debug log is the "CBlock" line). I will test the newest code now on my other machine.

That's clearly unsatisfactory, I shall investigate further. AIUI, this is on Ubuntu Trusty? Is that on a 32-bit or 64-bit architecture? (I seem to have acquired two “Trusty” VMs, one for a 64 bit arch, one for a 32-bit but I have little idea whether the difference has any effect unless the actual machine on which I'm running it is 32-bit).

Quote
Just a small question about the version numbering: Am I right that the "prerelease" branch would be the "stable" 0.4 version and the master branch is meant to be 0.5? Or are both 0.5? It's because I plan to update the OP a bit with the newest developments.

Now that the dust is beginning to settle on the codebase, we can switch the default github repos back to "master" and use the 0.5 tag to distinguish the supported Linux “0.5 release” build and use the release page to offer downloadable 0.5 binaries for Windows and OS X. Then we can return to the standard “developers work in their own branch” approach. The current “slimcoin” branch can simply be renamed to “slimcoin 0.4”.

As far as I can figure out from reading the source code, the release version advertised by the running app is taken from the last git tag (which explains why changing the version number in version.h seems to have no effect).

Locally, I could tag my clone as 0.6.6.6, compile the app and the running app would report 0.6.6.6. If I were to push that tag to the public repos, all subsequently cloned+compiled apps would advertise themselves as 0.6.6.6.

There's a 6th-level git wizard's spell of push-release-tag-to-public-repos to be uttered at some point (RTFM, Graham). After this, the GitHub repos “release” page can then be loaded with the (correctly-functioning) platform-specific binaries of Slimcoin 0.5 for Windows and OS X.

Organic life-forms are advised not to try this with Linux binaries because, basically, there's only one supported latest version of Windows and OS X and therefore static libs are reliable on those platforms whereas that is not the case with Linux where dynamic libraries are the norm (AIUI). I could offer Linux builds that link against dynamic system  libraries but I'm not in a position to offer support for local deployment on arbitrary Linux systems with arbitrarily-different dynamic libs.

What I can offer is a standalone deployment script using Vagrant (for an optional VM-based build) and ansible provisioning. Ansible is a Python+YAML devops tool which scripts the d/l+compile sequence to either localhost or a Vagrant VM using standard apt-get install to provision the host appropriately to the specific Linux distro and version (g++, Qt, openssl, miniupnpc, qrencode, etc).

Even if folks don't want to go as far as a VM build, the Ansible “playbook” spells out each step in excruciating detail, f'rinstance this stanza is from the companion MXE-compile-Slimcoin playbook (step-by-step cross-compile build from source on a VM for increased peace-of-mind) that retrieves Qt sources, nukes the mysql references and compiles:

Code:
---
  - name: remove mysqllib from Qt5 compilation
    action:  shell cd /mnt/mxe; grep -v -- '-mysql' src/qtbase.mk | sed -e 's/libmysqlclient //' > /tmp/foo; mv /tmp/foo src/qtbase.mk;

  - name: compile Qt5
    action:  shell cd /mnt/mxe; make MXE_TARGETS="i686-w64-mingw32.static" qttools
    register: qtreport
  - debug:
      msg: '{{ qtreport }}'

This is just an illustrative example in which I tested my hypothesis that the mysql references could be relatively trivially removed from the standard MXE cross-compile build were it to prove desirable.

(And yup, it did run all the way through and created a Windows binary from freshly-compiled libs but I admit to not having the patience to wait for the emulated binary to read the blockchain+index. Perhaps I'll let it play out sometime over the w/e while Ngaio and I are enjoying re-watching John Carpenter's much-overlooked 1974 directorial debut film Dark Star, recently re-posted to youtube in good-quality form.)


Cheers

Graham
legendary
Activity: 3906
Merit: 6249
Decentralization Maximalist
When compiling the daemon, just use the standard make -f makefile.unix

Thanks! The compilation works now with Boost 1.54. Unfortunately, the daemon still crashes (segfaults) about ~10 minutes after startup (as before, last sign of life in debug log is the "CBlock" line). I will test the newest code now on my other machine.

Just a small question about the version numbering: Am I right that the "prerelease" branch would be the "stable" 0.4 version and the master branch is meant to be 0.5? Or are both 0.5? It's because I plan to update the OP a bit with the newest developments.
Jump to: